package gov.ccswj.modules.bdbusiness.controller;

import java.util.List;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import gov.ccswj.modules.bdbusiness.entity.AZhishikuPolicyEntity;
import gov.ccswj.modules.bdbusiness.service.AZhishikuPolicyService;
import gov.ccswj.common.utils.PageUtils;
import gov.ccswj.common.utils.Query;
import gov.ccswj.common.utils.R;




/**
 * 
 * 
 * @author KY.Cheng
 * @email ********@gmail.com
 * @date 2017-11-22 11:05:48
 */
@RestController
@RequestMapping("/bdbusiness/azhishikupolicy")
public class AZhishikuPolicyController {
	@Autowired
	private AZhishikuPolicyService aZhishikuPolicyService;
	
	/**
	 * 列表
	 */
	@RequestMapping("/list")
	@RequiresPermissions("bdbusiness:azhishikupolicy:list")
	public R list(@RequestParam Map<String, Object> params){
		//查询列表数据
        Query query = new Query(params);

		List<AZhishikuPolicyEntity> aZhishikuPolicyList = aZhishikuPolicyService.queryList(query);
		int total = aZhishikuPolicyService.queryTotal(query);
		
		PageUtils pageUtil = new PageUtils(aZhishikuPolicyList, total, query.getLimit(), query.getPage());
		
		return R.ok().put("page", pageUtil);
	}
	
	
	/**
	 * 信息
	 */
	@RequestMapping("/info/{id}")
	@RequiresPermissions("bdbusiness:azhishikupolicy:info")
	public R info(@PathVariable("id") Integer id){
		AZhishikuPolicyEntity aZhishikuPolicy = aZhishikuPolicyService.queryObject(id);
		
		return R.ok().put("aZhishikuPolicy", aZhishikuPolicy);
	}
	
//	/**
//	 * 保存
//	 */
//	@RequestMapping("/save")
//	@RequiresPermissions("bdbusiness:azhishikupolicy:save")
//	public R save(@RequestBody AZhishikuPolicyEntity aZhishikuPolicy){
//		aZhishikuPolicyService.save(aZhishikuPolicy);
//		
//		return R.ok();
//	}
//	
//	/**
//	 * 修改
//	 */
//	@RequestMapping("/update")
//	@RequiresPermissions("bdbusiness:azhishikupolicy:update")
//	public R update(@RequestBody AZhishikuPolicyEntity aZhishikuPolicy){
//		aZhishikuPolicyService.update(aZhishikuPolicy);
//		
//		return R.ok();
//	}
//	
//	/**
//	 * 删除
//	 */
//	@RequestMapping("/delete")
//	@RequiresPermissions("bdbusiness:azhishikupolicy:delete")
//	public R delete(@RequestBody Integer[] ids){
//		aZhishikuPolicyService.deleteBatch(ids);
//		
//		return R.ok();
//	}
	
}
